package com.training;

import java.io.Serializable;

import com.training.exception.PayCaluclatorException;

public abstract class Employee implements Serializable {

	private String firstName;
	private String id;
	private String lastName;
	private int defaultWorkHoursPerDay;
	private int hourRate;
	
	
	/**
	 * @return the hourRate
	 */
	public int getHourRate() {
		return hourRate;
	}
	/**
	 * @param hourRate the hourRate to set
	 */
	public void setHourRate(int hourRate) {
		this.hourRate = hourRate;
	}
	/**
	 * @return the firstName
	 */
	public String getFirstName() {
		return firstName;
	}
	/**
	 * @param firstName the firstName to set
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}
	/**
	 * @return the lastName
	 */
	public String getLastName() {
		return lastName;
	}
	/**
	 * @param lastName the lastName to set
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	/**
	 * @return the defaultWorkHoursPerDay
	 */
	public int getDefaultWorkHoursPerDay() {
		return defaultWorkHoursPerDay;
	}
	/**
	 * @param defaultWorkHoursPerDay the defaultWorkHoursPerDay to set
	 */
	public void setDefaultWorkHoursPerDay(int defaultWorkHoursPerDay) {
		this.defaultWorkHoursPerDay = defaultWorkHoursPerDay;
	}
	
	
	public int caluclatePay() throws PayCaluclatorException
	{
		if(defaultWorkHoursPerDay == 0)
		{
			throw new PayCaluclatorException();
		}
		
		System.out.println("This will print only in normal case");
		
		return (hourRate * defaultWorkHoursPerDay)*5;
		
	}
	
	 
}